IF(UNIX)
  IF(RUN_CONFIGURE)
    EXEC_PROGRAM(aclocal ${ABINITDIR})
    EXEC_PROGRAM(autoconf ${ABINITDIR})
    EXEC_PROGRAM(automake ${ABINITDIR} ARGS -a)

    EXEC_PROGRAM(
    "${ABINITDIR}/configure --prefix=${PROJECT_BINARY_DIR}" ${ABINITDIR}
    )
    EXEC_PROGRAM(make ${ABINITDIR})
    EXEC_PROGRAM("make install" ${ABINITDIR})
    FIND_LIBRARY(ABINIT_LIBRARY abinit ${PROJECT_BINARY_DIR}/lib)
 ENDIF(RUN_CONFIGURE)
ENDIF(UNIX)

MARK_AS_ADVANCED(ABINIT_LIBRARY)

#EXEC_PROGRAM(rm ${ABINITDIR} ARGS -f Makefile libabinit.a)
#CONFIGURE_FILE(${ABINITDIR}/Makefile.in ${ABINITDIR}/Makefile)
#EXEC_PROGRAM(make ${ABINITDIR} ARGS -f Makefile)
#EXEC_PROGRAM(cp ${ABINITDIR} ARGS "libabinit.a ${LIBRARY_OUTPUT_PATH}/")
